<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 
            必须是定位的元素top,right,bottom,left属性才能生效
            绝对定位的元素在文档流中不占位置
            绝对定位是参照父元素定位的位置
            每次只需要从上下和左右各选一边就可以改变位置

            父元素必须是定位的元素才能作为参照物进行定位
            一般设置position: relative;作为定位的元素
        */
        .d1 {
            width: 100px;
            height: 100px;
            border: solid;
            position: absolute;
            top: 100px;
            left: 100px;
            /* bottom: 100px; */
            /* right: 100px; */
        }
        .box {
            width: 400px;
            height: 400px;
            border: solid;
            margin: 40px auto;
            position: relative;
        }
        .son {
            width: 100px;
            height: 100px;
            border: 1px solid red;
            position: absolute;
            top: 100px;
            left: 100px;
        }
    </style>
</head>
<body>
    <div class="d1"></div>
    <span>hello</span>
    <div class="box">
        <div class="son"></div>
    </div>
</body>
</html>